package com.tiyende.kash.loop.common

import com.tiyende.kash.loop.TiyendeApp
import com.tiyende.kash.loop.base.BasePresenter
import com.tiyende.kash.loop.request.IHttpCallback
import org.json.JSONObject

/**
 * CommonPresenter
 * @Author wwdeng
 * @CreateTime: 2024/11/20 10:32
 * @Annotation：
 */
abstract class CommonPresenter(private val iView: ICommonView): BasePresenter() {

    /**
     * 接口请求
     */
    fun doHttpPostAction(httpUrl: String, params: JSONObject, callback: IHttpCallback){
        iView.getAct().doPostAction(httpUrl, params,callback)
    }

    /**
     * 添加埋点
     */
    fun addEventPointRequestAction(eventName: String, eventRemark: String = "") {
        iView.getAct().addEventPointRequestAction(eventName,eventRemark)
    }

    /**
     * getString
     */
    fun getString(strId: Int): String{
        return TiyendeApp.app.getString(strId)
    }
}